<template>
  <div class="auth-container">
    <h2 class="mb-4">🦊 请选择您的身份</h2>
    <div class="role-cards">
      <div
        class="role-card"
        @click="goLogin('student')"
      >
        <i class="bi bi-person-vcard fs-1 text-primary mb-3"></i>
        <h4>学生登录</h4>
        <p class="text-muted">完成实验任务，提交作业</p>
      </div>
      <div
        class="role-card"
        @click="goLogin('teacher')"
      >
        <i class="bi bi-mortarboard fs-1 text-warning mb-3"></i>
        <h4>教师登录</h4>
        <p class="text-muted">发布实验，批改作业</p>
      </div>
    </div>
  </div>
</template>

<script setup>
import { useRouter } from 'vue-router'
const router = useRouter()
function goLogin(role) {
  router.push({ name: 'login', query: { role } })
}
</script>

<style scoped>
.auth-container {
  max-width: 500px;
  margin: 80px auto;
  padding: 30px;
  background: white;
  border-radius: 15px;
  box-shadow: 0 0 25px rgba(0, 0, 0, 0.1);
  text-align: center;
}
.role-cards {
  display: flex;
  gap: 20px;
  justify-content: center;
  margin-top: 30px;
}
.role-card {
  padding: 25px;
  border: 2px solid #eee;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.3s;
  width: 200px;
}
.role-card:hover, .role-card.active {
  border-color: #409eff;
  background-color: rgba(64, 158, 255, 0.05);
  transform: translateY(-5px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}
.role-card i {
  font-size: 2.5rem;
  margin-bottom: 15px;
  color: #409eff;
}
.role-card h4 {
  margin: 10px 0;
}
</style>